<?php
/**
 * @copyright   2008-2014 简好网络 <http://www.phpshe.com>
 * @creatdate   2012-0501 koyshe <koyshe@gmail.com>
 */
pe_lead('hook/cache.hook.php');
$menumark = 'setting';
switch ($act) {
    //#####################@ 公司介绍设置 @#####################//
    case 'set':

        include(pe_tpl('setting_introduction.html'));
        break;
    //#####################@ 章程 @#####################//
    case 'rule':

        include(pe_tpl('setting_rule.html'));
        break;
    //#####################@ 架构 @#####################//
    case 'organization':
        include(pe_tpl('setting_organization.html'));
        break;
    //#####################@ 网站设置 @#####################//
    default:
        if (isGet()) {
            $setting = $db->index('setting_key')->pe_selectall('setting');

            include(pe_tpl('setting_base.html'));
        } else if (isPost()) {
//            mp($_p_info);exit;
            $sql = "update `" . dbpre . "setting` set `setting_value` = case `setting_key`  
				when 'web_contact' then '" . pe_dbhold($_p_info['web_contact']) . "'
				when 'web_aboutus' then '" . pe_dbhold($_p_info['web_aboutus']) . "'
				when 'web_moneycard' then '" . pe_dbhold($_p_info['web_moneycard']) . "'
				when 'web_cardname' then '" . pe_dbhold($_p_info['web_cardname']) . "' else `setting_value` end";
                
            if ($db->sql_update($sql)) {
                cache_write('setting');
                pe_success('设置成功!');
            } else {
                pe_error('设置失败...');
            }
        }

        break;
}
?>